#pragma once

#ifndef DFC_DET_H
#define DFC_DET_H

#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#include <iostream>
#include "net.h"
#include "time.h"


float max_float(float x, float y, float z);


class CrackSeg
{
private:
	std::string param_path;
	std::string bin_path;
	std::vector<int> input_shape;
	ncnn::Net crack_net;

	// const float norm_vals[3] = { 1 / 177.5, 1 / 177.5, 1 / 177.5 };
	// const float mean_vals[3] = { 175.5, 175.5, 175.5 };
	
	// const float norm_vals[3] = {1 / 255., 1 / 255., 1 / 255.};
	// const float mean_vals[3] = {0, 0, 0};

	const float MEAN_VALS[3] = {123.675f, 116.28f, 103.53f};
	const float NORM_VALS[3] = {1 / 58.395f, 1 / 57.12f, 1 / 57.375f};

public:
	CrackSeg() = delete;
	CrackSeg(const std::string param_path, const std::string bin_path, std::vector<int> input_shape);
	~CrackSeg();

	cv::Mat predict_image(cv::Mat &image);
	void predict_image(const std::string &src_image_path, const std::string &dst_path);
	void predict_camera();
};

#endif